﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CubicFWNet.Data.Models;
using CubicFWNet.Data.SystemManager;

namespace CubicFWNet.Application.SystemManager
{
    public class OperateRecordApp
    {
        private OperateRecordRepository _service = new OperateRecordRepository();
        private OrderRepository _serviceOrder = new OrderRepository();

        public OperateRecord GetSingleOrderProduct(Guid id)
        {
            return _service.FindEntity(a => a.Id == id);
        }

        public int AddOperateRecord(OperateRecord web)
        {
            return _service.Insert(web);
        }

        public int UpdateOperateRecord(OperateRecord web)
        {
            return _service.UpdateOperateRecord(web);
        }

        public Order GetSingleOrder(Guid id)
        {
            return _serviceOrder.FindEntity(a => a.Id == id);
        }
        public int UpdateOrderStateById(Guid id, int status)
        {
            return _service.UpdateOrderStateById(id, status);
        }
        public int UpdateOrderStateAndIniById(Guid id, int status, decimal initPrice)
        {
            return _service.UpdateOrderStateAndIniById(id, status, initPrice);
        }
    }
}
